Condition

interface Condition

Defines a contract for representing a condition that can be evaluated.

Conditions are used to determine whether certain criteria are met, often for controlling content display, triggering actions, or implementing conditional logic within the player. Each condition has a type, an evaluation sequence, an operator to combine it with other conditions, and up to four generic values that can be interpreted based on the condition's type.

The interface provides methods to access these values as strings, integers, doubles, or dates, allowing implementations to store and retrieve condition parameters in a flexible manner. Conditions are intended to be evaluated in a specific order, determined by their sequence number.

Example Scenario: A condition might check if the current time is within a specific range (using date values), or if a certain device capability is present (using string values).

Properties

Link copied to clipboard
val OPERATOR_AND: Int = 0
Operator constant representing a logical AND.
Link copied to clipboard
Operator constant representing a logical AND NOT.
Link copied to clipboard
val OPERATOR_OR: Int = 1
Operator constant representing a logical OR.
Link copied to clipboard
Operator constant representing a logical OR NOT.

Functions

Link copied to clipboard
abstract fun getDateValue1(): Date
Gets the first generic value, attempting to interpret it as a Date.
Link copied to clipboard
abstract fun getDateValue2(): Date
Gets the second generic value, attempting to interpret it as a Date.
Link copied to clipboard
abstract fun getDateValue3(): Date
Gets the third generic value, attempting to interpret it as a Date.
Link copied to clipboard
abstract fun getDateValue4(): Date
Gets the fourth generic value, attempting to interpret it as a Date.
Link copied to clipboard
abstract fun getDoubleValue1(): Double
Gets the first generic value, attempting to interpret it as a double.
Link copied to clipboard
abstract fun getDoubleValue2(): Double
Gets the second generic value, attempting to interpret it as a double.
Link copied to clipboard
abstract fun getDoubleValue3(): Double
Gets the third generic value, attempting to interpret it as a double.
Link copied to clipboard
abstract fun getDoubleValue4(): Double
Gets the fourth generic value, attempting to interpret it as a double.
Link copied to clipboard
abstract fun getIntValue1(): Int
Gets the first generic value, attempting to interpret it as an integer.
Link copied to clipboard
abstract fun getIntValue2(): Int
Gets the second generic value, attempting to interpret it as an integer.
Link copied to clipboard
abstract fun getIntValue3(): Int
Gets the third generic value, attempting to interpret it as an integer.
Link copied to clipboard
abstract fun getIntValue4(): Int
Gets the fourth generic value, attempting to interpret it as an integer.
Link copied to clipboard
abstract fun getOperator(): Int
Gets the logical operator used to combine this condition with a preceding condition or a default state.
Link copied to clipboard
abstract fun getSequence(): Int
Gets the sequence number of this condition.
Link copied to clipboard
abstract fun getType(): String
Gets the type of condition, which determines how its values are interpreted and evaluated.
Link copied to clipboard
abstract fun getValue1(): String
Gets the first generic value associated with this condition, as a string.
Link copied to clipboard
abstract fun getValue2(): String
Gets the second generic value associated with this condition, as a string.
Link copied to clipboard
abstract fun getValue3(): String
Gets the third generic value associated with this condition, as a string.
Link copied to clipboard
abstract fun getValue4(): String
Gets the fourth generic value associated with this condition, as a string.